Fix method to update menu sensitivity of combo box
authorAdam Reichold <adam.reichold@t-online.de>
Sun, 6 Dec 2015 10:30:58 +0000 (11:30 +0100)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 7 Dec 2015 16:23:18 +0000 (11:23 -0500)
After removal of the selectable header and separator from the combo box,
the method to update the menu sensitivity must be changed as it assumes
at least two items within each sub menu and contains special handling
for the separator. Removing this fixes bug #759079.

gtk/gtkcombobox.c

index 0831ce69653a13958e1a30387c3395a0f44161cb..c6304229d1bd89e5b09d9f06fb08b10ff005f997 100644 (file)
@@ -2073,7 +2073,7 @@ update_menu_sensitivity (GtkComboBox *combo_box,
 {
   GtkComboBoxPrivate *priv = combo_box->priv;
   GList *children, *child;
-  GtkWidget *item, *submenu, *separator;
+  GtkWidget *item, *submenu;
   GtkWidget *cell_view;
   gboolean sensitive;
 
@@ -2099,15 +2099,7 @@ update_menu_sensitivity (GtkComboBox *combo_box,
       else
         {
           sensitive = cell_layout_is_sensitive (GTK_CELL_LAYOUT (cell_view));
-
-          if (menu != priv->popup_widget && child == children)
-            {
-              separator = GTK_WIDGET (child->next->data);
-              g_object_set (item, "visible", sensitive, NULL);
-              g_object_set (separator, "visible", sensitive, NULL);
-            }
-          else
-            gtk_widget_set_sensitive (item, sensitive);
+          gtk_widget_set_sensitive (item, sensitive);
         }
     }